/** @format */

import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    shopcart: {
      count: 0
    }
  },
  mutations: {
    addstate(state) {
      state.shopcart.count++;
    },
    sumcount(state, payload) {
      state.shopcart.count = payload;
    }
  },
  actions: {
    addstate({ commit }) {
      commit("addstate");
    },
    sumcount({ commit }, payload) {
      commit("sumcount", payload);
    }
  },
  modules: {}
});
